#ifndef ANALYSIS_H
#define ANALYSIS_H

#include "TH1F.h"
#include "TH2F.h"
#include "TTree.h"
#include <vector>
#include <TFile.h>
#include "EvtData.h"
#include <string>
#include <map>
#include <set>
//A Base Analysis Class


class Analysis{
  
  public :
  Analysis();
  virtual ~Analysis();
  virtual void FillHisto(std::string,double);
  virtual void FillHisto(std::string,double,double);
  virtual void Execute()=0;// this function has to be over-riden in derived classes !!!
  virtual void Finalize(TString);// Write Histograms into the file etc ...
  virtual std::map<std::string,TH1F*> getTH1FMap();
  virtual void Configure(std::string);
  static std::set<std::string> ConfiguredAnalysesList;
  //static std::set<std::string> AnalysesList;
  std::string name;
  bool doGRL;
  void SetEvtData(EvtData*);
  EvtData* GetEvtdata();
  void setTree(TTree*);
  TTree* getTree();
  
  protected:

  std::map<std::string,TH1F*> TH1FMap;//your analysis histograms are held i this map. (Access string::TH1F )
  std::vector<std::string> TH1FKeys;//This list holds the string keys (TH1F names) to acees them from the map
  std::map<std::string,TH2F*> TH2FMap;
  std::vector<std::string> TH2FKeys;
 EvtData* evtdata;
 TTree* thetree;
};


#endif


